<h4>Papers</h4>
<hr>
<script>
    (function() {
        var cx = '007811971483679200415:nusipjn2syi';
        var gcse = document.createElement('script');
        gcse.type = 'text/javascript';
        gcse.async = true;
        gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
            '//www.google.com/cse/cse.js?cx=' + cx;
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(gcse, s);
    })();
</script>
<ul>
    <li><h5>Search for scholar papers</h5>
        <ul><li>
            <gcse:search></gcse:search>
    </li></ul>
</li>
<li><h5>UNL papers</h5>
    <?php if (isset($data) && count($data)) { ?>

        <ul>
            <table class="dataTable">
                <thead>
                    <th>Date</th>
                    <th>Name</th>
                    <th>File</th>
                    <th>Description</th>
                </thead>
                <?php
                foreach ($data as $paper) {
                    $file = $paper['filepath'].$paper['filename'];
                    echo "<tr>";
                    echo "<td>" . $paper['date'] . "</td>";
                    echo "<td>" . $paper['name'] . "</td>";
                    echo "<td>" . "<i class='icon-docs'></i>" ."<a href='$file' target='_blank'>Click to download</a>" . "</td>";
                    echo "<td>" . $paper['description'] . "</td>";
                    echo "</tr>";
                }
                ?>
            </table>
            <!--        <li>
                        Paper name -- file to download -- publication date
                    </li>
                    <li>
                        Paper name -- file to download -- publication date
                    </li>
                    <li>
                        Paper name -- file to download -- publication date
                    </li>
                    <li>
                        Paper name -- file to download -- publication date
                    </li>
                    <li>
                        Paper name -- file to download -- publication date
                    </li>-->
        </ul>
    </li>
<?php } else {
    echo "No file available!";
}
?>